<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateClientsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('clients', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('agent_id')->index()->comment('代理商 ID');
            $table->string('name')->comment('客户名称');
            $table->char('phone', 11)->comment('手机号');

            $table->char('province', 16)->default('')->comment('省');
            $table->char('city', 16)->default('')->comment('市');
            $table->char('area', 16)->default('')->comment('区');
            $table->string('address')->default('')->comment('详细地址');

            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('clients');
    }
}
